﻿<shared:PageBase x:Class="Bymed.SpineScan.WPF.BasicConfigurationPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:shared="clr-namespace:Bymed.SpineScan.WPF.Shared"
      mc:Ignorable="d" 
      x:Name="CurrentPage" 
      d:DesignHeight="1000" d:DesignWidth="1280"
	  Title="BasicConfigurationPage" Style="{StaticResource DefaultPageStyle}" 
      DataContext="{Binding BasicConfiguration, Source={StaticResource Locator}}">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Skins/Storyboard/PageStoryborad.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="{x:Type ComboBox}">
                <Setter Property="FontSize" Value="16" />
                <Setter Property="Width" Value="120" />
                <Setter Property="IsReadOnly" Value="True" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="VerticalAlignment" Value="Top" />
            </Style>
        </ResourceDictionary>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <!-- Main Content -->
            <RowDefinition Height="Auto" />
            <!-- Navigation Buttons -->
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid>
            <Grid.Background>
                <ImageBrush ImageSource="/Skins/Resource/Image/GrayRightAboveTabBackground.png" />
            </Grid.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <!-- Page Title -->
                    <RowDefinition Height="55" />
                    <!-- Data Management Functions -->
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBlock Text="选项配置" Margin="0,15,40,0" HorizontalAlignment="Right" Style="{StaticResource PageTitleTextBlock}" />
                <Grid Grid.Row="1" Margin="20,0,20,0" Height="500">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Border Margin="0,0,0,15" Style="{StaticResource OperationPortionBorder}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="120" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <!-- Title -->
                                <RowDefinition Height="Auto" />
                                <!-- Patient Number Prefix -->
                                <RowDefinition Height="Auto" />
                                <!-- Patient Number Date Part -->
                                <RowDefinition Height="Auto" />
                                <!-- Patient Number Initial Sequence -->
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <TextBlock Grid.ColumnSpan="2" Margin="0,0,0,10" Text="被测者编号设置" Style="{StaticResource InfoTextBlock}" />
                            <TextBlock Grid.Row="1" Text="号码前部" Margin="0,0,0,20" Style="{StaticResource TestReportTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding PatientNumberPrefix}" Width="150" Height="30" Style="{StaticResource RegularTextBox}" />
                            <TextBlock Grid.Row="2" Margin="0,0,0,20" Text="日期" Style="{StaticResource TestReportTextBlock}" />
                            <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal">
                                <CheckBox IsChecked="{Binding PatientNumberContainsYear}" Content="年" FontSize="16" Padding="4,0,0,0" Margin="0,0,20,0" VerticalAlignment="Top" Style="{StaticResource GreenCheckBoxStyle}" />
                                <CheckBox IsChecked="{Binding PatientNumberContainsMonth}" Content="月" FontSize="16" Padding="4,0,0,0" Margin="0,0,20,0" VerticalAlignment="Top" Style="{StaticResource GreenCheckBoxStyle}" />
                                <CheckBox IsChecked="{Binding PatientNumberContainsDay}" Content="日" FontSize="16" Padding="4,0,0,0" VerticalAlignment="Top" Style="{StaticResource GreenCheckBoxStyle}" />
                            </StackPanel>
                            <TextBlock Grid.Row="3" Text="顺序号" Style="{StaticResource TestReportTextBlock}" />
                            <ComboBox Grid.Column="1" Grid.Row="3" ItemsSource="{Binding PatientNumberInitializedSequenceList}" SelectedValue="{Binding PatientNumberInitializedSequence}" />
                        </Grid>
                    </Border>
                    <Border Margin="0,0,0,15" Grid.Row="1" Style="{StaticResource OperationPortionBorder}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="120" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <!-- Title -->
                                <RowDefinition Height="Auto" />
                                <!-- Company Name -->
                                <RowDefinition Height="Auto" />
                                <!-- Company Address -->
                                <RowDefinition Height="Auto" />
                                <!-- Company Phone Number  -->
                                <RowDefinition Height="Auto" />
                                <!-- Report Title -->
                                <RowDefinition Height="Auto" />
                                <!-- Department Name -->
                                <RowDefinition Height="Auto" />
                                <!-- Logo -->
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <TextBlock Grid.ColumnSpan="2" Margin="0,0,0,10" Text="系统设置" Style="{StaticResource InfoTextBlock}" />
                            <TextBlock Grid.Row="1" Text="单位名称" Margin="0,0,0,20" Style="{StaticResource TestReportTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding CompanyName}" Width="300" Height="30" Style="{StaticResource RegularTextBox}" />
                            <TextBlock Grid.Row="2" Margin="0,0,0,20" Text="单位地址" Style="{StaticResource TestReportTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding CompanyAddress}" Width="300" Height="30" Style="{StaticResource RegularTextBox}" />
                            <TextBlock Grid.Row="3" Margin="0,0,0,20" Text="联系电话" Style="{StaticResource TestReportTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="3" Text="{Binding CompanyPhoneNumber}" Width="300" Height="30" Style="{StaticResource RegularTextBox}" />
                            <TextBlock Grid.Row="4" Margin="0,0,0,20" Visibility="Collapsed" Text="报告名称" Style="{StaticResource TestReportTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="4" Visibility="Collapsed" Text="{Binding TestReportTitle}" Width="300" Height="30" Style="{StaticResource RegularTextBox}" />
                            <TextBlock Grid.Row="5" Text="科室名称" Margin="0,0,0,20" Style="{StaticResource TestReportTextBlock}" />
                            <TextBox Grid.Column="1" Grid.Row="5" Text="{Binding DepartmentName}" Width="300" Height="30" Style="{StaticResource RegularTextBox}" />
                            <TextBlock Grid.Row="6" Text="Logo图片" Style="{StaticResource TestReportTextBlock}" />
                            <StackPanel Grid.Column="1" Grid.Row="6" Orientation="Horizontal">
                                <Image Width="60" Source="{Binding CompanyLogoFileFullName}" />
                                <TextBox x:Name="TxtCompanyLogoFileFullName" Text="{Binding CompanyLogoFileFullName, 
                                    Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" 
                                         Width="300" Height="30" Style="{StaticResource RegularTextBox}" Visibility="Collapsed" />
                                <Button x:Name="BtnSelectCompanyLogoFile" Margin="10,0,0,0" Width="30" ToolTip="浏览" Tag="/Skins/Resource/Image/Folder-Open.png" 
                                        Style="{StaticResource OpacityImageButton}" VerticalAlignment="Center"
                                    Click="BtnSelectCompanyLogoFile_Click" />
                            </StackPanel>
                        </Grid>
                    </Border>
                </Grid>
            </Grid>
        </Grid>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <Button Content="保存并返回" Margin="0,0,120,0" Tag="/Skins/Resource/Image/Save.png" Style="{StaticResource NavigationButton}" Command="{Binding SaveCommand}" />
            <Button Content="取消并返回" Margin="0,0,120,0" Tag="/Skins/Resource/Image/Cancel.png" Style="{StaticResource NavigationButton}" Click="ButtonCancel_Click" />
        </StackPanel>
    </Grid>
</shared:PageBase>
